
console.log( 1 );

const executor = (resolve,reject) => {
    console.log( 2 );
    setTimeout( ()=>{
        console.log( 3 );
        resolve();  
        console.log( 4 );
    } , 500 ),
    console.log( 5 );
}

let timer = setTimeout( () => {
    console.log( 6 );
    let p = new Promise( executor ) ;
    p.then( value => console.log( 7 , value ) )
     .catch( reason => console.log( 8 , reason) )
     .finally( () => console.log( 9 ) );
    console.log( 10 );
} , 100 );

console.log( 11 , typeof timer );